
import { Outlet } from "react-router"
import { Tabs } from 'antd';
import React, { useState } from 'react';
import { useNavigate } from "react-router";
// import Column from "antd/es/table/Column";
// import './index.scss'
const App = () => {
    const path = window.location.hash.split('/')
    const navigate=useNavigate()
    const [activeKey,setactiveKsy]=useState('/' + path[1] + '/' + path[2])
    const onChange = (key) => {
        setactiveKsy(key)
        navigate(key)
    };
    const items = [
        {
            key: '/mycourse/waitclass',
            label: '待上课程',
        },
        {
            key: '/mycourse/screenrecord',
            label: '课程记录',
        },
        {
            key: "/mycourse/freetime",
            label:'空闲时间',
        },
    ];

    return (
        <div 
        style={{
            display:"flex",
            flexDirection:"Column",
            overflow:"auto",
        }}
        >
            <Tabs activeKey={activeKey} items={items} onChange={onChange} 
            />
            <Outlet/>
        </div>
    )
}
export default App;
